package com.mes.md.service.impl;

import com.mes.md.mapper.UnitMapper;
import com.mes.md.service.UnitService;
import com.mes.pojo.md.Unit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author hitsune
 * @Company kafu chino
 * @Description
 * @Time 2024/10/18 18:33
 */
@Service
public class UnitServiceImpl implements UnitService {

    @Autowired
    private UnitMapper unitMapper;

    @Override
    public List<Unit> unitList(Long unitId) {
        return unitMapper.unitList(unitId);
    }

    @Override
    public List<Unit> queryUnitList(Unit unit) {
        return unitMapper.queryUnitList(unit);
    }

    @Override
    public List<Unit> queryMainUnitList() {
        return unitMapper.queryMainUnitList();
    }

    @Override
    public Integer addUnit(Unit unit) {
        return unitMapper.addUnit(unit);
    }

    @Override
    public Integer deleteUnit(Long unitId) {
        return unitMapper.deleteByUnitId(unitId);
    }

    @Override
    public Unit selectUnitById(Long unitId) {
        return unitMapper.selectUnitById(unitId);
    }

    @Override
    public Integer updateUnit(Unit unit) {
        return unitMapper.updateUnit(unit);
    }

    @Override
    public Integer deleteUnits(List<Unit> units) {
        return unitMapper.deleteUnits(units);
    }
}
